<template>
	<view>
		<view class="bj">
			<u-navbar title="团购优惠" :autoBack="true" bgColor="#3284fc"
				titleStyle="font-size:18px; color:white;height:44px;line-height:44px" leftIconColor="#fff">
			</u-navbar>
			<view style="margin-top: 50px;">
				<u-cell-group :border="false"
					:customStyle="{backgroundColor:'#ffffff',borderRadius:'10px',margin:'10px auto',width:'350px'}">
					<view class="mc">
						<span v-if="active != null">
							{{active.title}}
						</span>
					</view>
					<view class="rq">
						<view>{{shop.storeName}}</view>
						<view>
						<span v-if="active != null">
							{{active.createTime}}
						</span>
						</view>
					</view>
					<view v-if="active != null">
						<image :src="active.photo"></image>
					</view>
					<view class="xq">
						<span v-if="active != null">
							{{active.content}}
						</span>
					</view>
				</u-cell-group>
				<u-cell-group :border="false"
					:customStyle="{backgroundColor:'#ffffff',borderRadius:'10px',margin:'10px auto',width:'350px'}">
					<view class="sy">
						<view class="jg">
							<view style="color: #ff3300; font-size: 14px;">价格：￥99.00</view>
							<view style="margin:2px 0 0 10px;color: #a9a9a9;"><s>原价:￥199.00</s></view>
						</view>
						<view>
							活动起止日期：2023-3-10 08:00 至 2023-3-18 23:59
						</view>
						<view>咨询电话:{{shop.perPhone}}</view>
						<view>注意事项：暂无</view>
					</view>

				</u-cell-group>
			</view>

		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				id:null,
				active:null,
				shopId:null,
				shop:'',
			}
		},
		onLoad(e){
			// console.log(e.id)
			this.id=e.id
			this.getActive();
			
		},
		methods: {
			getActive(){
				let that = this;
				this.$http({
					url:'api/activity/activity/'+ that.id,
					method:'GET',
					success(res){
						console.log(res)
						that.active=res.data.data;
						that.shopId=res.data.data.shopId
						that.getShop()
						// console.log(that.shopId)
					}
				})
			},
			getShop(){
				let that = this;
				this.$http({
					url:'api/shop/shop/'+that.shopId,
					method:'GEt',
					success(res){
						console.log(res)
						that.shop=res.data.data;
					}
				})
			}
		}
	}
</script>

<style scoped>
	.sy{
		margin: 10px 20px;
		font-size: 12px;
		line-height: 25px;
	}
	.jg{
		display: flex;
	}
	.xq {
		margin: 0 20px;
		font-size: 11px;
		color: #101010;
	}

	.mc {
		font-size: 18px;
		font-weight: 600;
		text-align: center;
		margin: 20px 0;
	}

	.rq {
		display: flex;
		justify-content: space-between;
		margin: -10px 20px 0 20px;
		color: #a9a9a9;
	}

	image {
		width: 320px;
		height: 195px;
		margin: 10px 15px;
		border-radius: 10px;
	}

	.bj {
		width: 100%;
		height: 220px;
		background-color: #3384fc;
	}
</style>